package com.ibiaoke.order.service;

import com.ibiaoke.common.base.Page;
import com.ibiaoke.customer.dao.XcxOpenGroupDao;
import com.ibiaoke.customer.entity.Customer;
import com.ibiaoke.customer.entity.XcxOpenGroup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class XcxOpenGroupServiceImpl implements XcxOpenGroupService {

    @Autowired
    private XcxOpenGroupDao xcxOpenGroupDao;

    @Override
    public XcxOpenGroup getOpenGroup(Integer id) {
        return xcxOpenGroupDao.selectByPrimaryKey(id);
    }

    @Override
    public List<XcxOpenGroup> checkXcxOpenGroup(String OpenCode, Integer goodId, Integer customerId) {
        return xcxOpenGroupDao.checkXcxOpenGroup(OpenCode,goodId,customerId);
    }

    @Override
    public List<XcxOpenGroup> listXcxOpenGroup(Integer XcxGoodsId, Integer shopId,Page page) {
        return xcxOpenGroupDao.listXcxOpenGroup(XcxGoodsId,shopId,page);
    }

    @Override
    public XcxOpenGroup getXcxOpenGroupByOpenCodeAndUserIdAndXcxGoodsId(String OpenCode, Customer customer, Integer xcxGoodsId) {
        return xcxOpenGroupDao.getXcxOpenGroupByOpenCodeAndUserIdAndXcxGoodsId(OpenCode,customer,xcxGoodsId);
    }

    @Override
    public List<XcxOpenGroup> getPtOpenGroupByOpenCodeAndPtGoodsId(String OpenCode, Integer xcxGoodsId) {
        return xcxOpenGroupDao.getPtOpenGroupByOpenCodeAndPtGoodsId(OpenCode,xcxGoodsId);
    }
}
